
// TokenKey 是用于存储身份验证令牌的常量
const TokenKey = 'vue_admin_template_token'

const UserInfoKey = 'UserInfo'

const RoleResourceKey = 'RoleResource'

export function getToken() {
  return localStorage.getItem(TokenKey)
}

export function setToken(token) {
  return localStorage.setItem(TokenKey, token)
}

export function removeToken() {
  return localStorage.removeItem(TokenKey)
}

export function getUserInfo() {
  return JSON.parse(localStorage.getItem(UserInfoKey))
}
export function setUserInfo(userInfo) {
  return localStorage.setItem(UserInfoKey, userInfo)
}

export function removeUserInfo() {
  return localStorage.removeItem(UserInfoKey)
}

export function setRoleResource(roleResource) {
  localStorage.setItem(RoleResourceKey, roleResource)
}

export function getRoleResource() {
  return localStorage.getItem(RoleResourceKey)
}

export function removeRoleResource() {
  return localStorage.removeItem(RoleResourceKey)
}

